from flask import Blueprint, request, jsonify
import logging, os
from utils import common
admin_bp = Blueprint('admin', __name__, url_prefix='/admin')


from app.admin.config import register_config
register_config(admin_bp)
# modules_and_functions = common.find_modules_and_functions(os.path.dirname(__file__))

# for module, impls in modules_and_functions:
#     for impl in impls:
#         admin_bp.add_url_rule(f"{module.__name__}/{impl if impl.find('_') == -1  else '/'.join(impl.split('_'))}", impl, getattr(module, impl))

# admin_bp = common.add_url_to_bp(os.path.dirname(__file__), admin_bp)

@admin_bp.record
def log(app):
    logging.info('register admin blueprint')
